package de.gameduell.framework.facebook.app.popups {
	import de.gameduell.framework.facebook.app.pyramide.Brick;

	import de.gameduell.framework.debug.Debug;
	import de.gameduell.framework.gui.button.ButtonEvent;

	public class SelectBrickPoup extends LevelUpPopup {
		private var oldBrickType:String;

		public function SelectBrickPoup(aBrick:Brick) {
			super(aBrick, "selectBrickPopup", "selectBrickPopup", true);
			registerButton("skipButton", hide);
			Debug.trace("SelectBrickPopup::SelectBrickPopup "+aBrick.brickType, Debug.ERROR);
			oldBrickType = aBrick.brickType;
			
			sprite.cacheAsBitmap = true;
			_showTween = null;
			_hideTween = null;
			
			_position.y = layout.contentPosition.y + 50;
		}

		override protected function onSelectionDone(event:ButtonEvent):void {
			Debug.trace("SelectBrickPoup::onSelectionDone: brick slected: " + event.button.id, Debug.DEBUG);
			brick.brickType = event.button.id;
			hide();
		}
	}
}
